package com.kgame5.xtank3d.model.tank.comp.flag {

/**
 * @author kangkai
 * 坦克的标签面板，这个已经作为md加到TankFSM.md的组里了，
 * 这个是直接操纵mc_tag的
 */	
import kgame5.k3d.core.obj3d.node3d.Sprite3D;
import kgame5.k3d.util3d.Factory3D;
import kgame5.kgui.gameui.LoadingRing;

import com.kgame5.xtank3d.model.tank.comp.flag.tagpane.HPBar;
import com.kgame5.xtank3d.model.tank.comp.flag.tagpane.NameBar;

import flash.display.MovieClip;

public class TagPane {
	
	public var md:Sprite3D;
	private var mc:MovieClip;
	
	private var nameBar:NameBar;
	
	private var hpBar:HPBar;
	
	private var loadingBar:LoadingRing;//装弹进度
	
	public function TagPane(){
		md=Factory3D.CreateSprite3D("MyMc_TagPaneX",false,false);
		mc = md.getDO() as MovieClip;
		
		loadingBar=new LoadingRing(mc.mc_loading);
		nameBar=new NameBar(mc.mc_name);
		hpBar=new HPBar(mc.mc_HP);
		
		//loadingBar.setColor(c)
		
		this.showSelfFlag(false);//自己的箭头
	}
	
	//显示自己的箭头标志
	public function showSelfFlag(b:Boolean):void{
		mc.mc_selfFlag.visible=b;
	}
	
	//
	public function setName(sName:String):void{
		nameBar.setName(sName);
	}
	
	public function setNameColor(color:int):void{
		nameBar.setNameColor(color);
	}
	
	public function startReload(lsd:int):void{
		loadingBar.start(lsd);
	}
	
	public function endReload():void{
		loadingBar.clear();
	}
	//
	public function setHP(hp:int,HP:int):void{
		hpBar.setHP(hp,HP);
	}
}//end of class
}
